﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Asah.SiteWorx.Commerce
{
    [Serializable()]
    public class CartItem
    {
        private string _itemNumber;
        private string _productTitle;
        private decimal _unitPrice;
        private int _quantity;
        
        public string ItemNumber
        {
            get
            {
                return _itemNumber;
            }
        }

        public string ProductTitle
        {
            get
            {
                return _productTitle;
            }
        }

        public decimal UnitPrice
        {
            get
            {
                return _unitPrice;
            }
        }

        public int Quantity
        {
            get
            {
                return _quantity;
            }
            internal set
            {
                _quantity = value;
            }
        }

        public decimal Total
        {
            get
            {
                return _unitPrice * _quantity;
            }
        }

        private CartItem()
        {
            // require use of factory methods
        }

        internal CartItem(string itemNumber, string productTitle, decimal unitPrice, int quantity)
        {
            _itemNumber = itemNumber;
            _productTitle = productTitle;
            _unitPrice = unitPrice;
            _quantity = quantity;
        }
        
    }
}
